<?php
namespace app\index\model;
use app\common\model\Base;

class Username extends Base
{





    //获取未打印的保安员列表 列表
    public function get_user($where,$limit){
        $data= $this->dao->select('*')
                    ->from('user')
                    ->where("$where")
                    ->orderby('id asc')
                    ->limit($limit)
                    ->fetchALL();
        return $data;
    }


   
    //更新用户登录信息
    public function updateLoginInfo($id,$login_key,$login_time,$usclass,$login_ip='',$login_num,$registration_id='') {
        $res = Username::name('username')
        ->bind(['id'=>$id,'login_key'=>$login_key,'login_time'=>$login_time,'login_ip'=>$login_ip,'us_class'=>$usclass,'login_num'=>$login_num,'registration_id'=>$registration_id])
        ->where('id',':id')
        ->update(['login_key'=>':login_key','login_time'=>':login_time','login_ip'=>':login_ip','us_class'=>':us_class','login_num'=>':login_num','registration_id'=>':registration_id']);
        return $res;
    }



}
